home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / Pascal / SWar / Globals.p < prev    next >
Text File  |  1995-06-15  |  2KB  |  94 lines

  1. unit Globals;
  2.  
  3. interface
  4.  
  5. {$IFC UNDEFINED THINK_PASCAL}
  6.     uses    Types, QuickDraw, Menus, Events;
  7. {$ENDC}
  8.  
  9.     const
  10. {NIL_POINTER = nil;}
  11.         MAX_PLAYERS = 4;
  12.  
  13.     type
  14.         SHIPREC = record
  15.                 where: Point;
  16.                 vel: Point;
  17.                 isAlive: Boolean;
  18.                 isAccel: Boolean;
  19.                 color: RGBColor;
  20.                 dir: Integer;
  21.                 anim: Integer;
  22.             end;
  23.  
  24.     const
  25.         MAX_SHOTS = 25;
  26.  
  27.     type
  28.         SHOTREC = record
  29.                 where: Point;
  30.                 vel: Point;
  31.                 isAlive: Boolean;
  32.                 color: RGBColor;
  33.                 lifeSpan: Integer;
  34.                 currentShape: Integer;
  35.             end;
  36.  
  37.     const
  38.         MAX_DEBRIS = 150;
  39.  
  40.     type
  41.         DEBRISREC = record
  42.                 where: Point;
  43.                 vel: Point;
  44.                 countdown: Integer;
  45.                 color: RGBColor;
  46.             end;
  47.  
  48.     const
  49.         MAX_STARS = 20;
  50.  
  51.     type
  52.         STARREC = record
  53.                 where: Point;
  54.                 color: RGBColor;
  55.             end;
  56.  
  57.  
  58.     var
  59.         gPictureWindow: CWindowPtr;
  60.         gOSPtr: CGrafPtr;
  61.         gScrapPtr: CGrafPtr;
  62.  
  63.         gNewMatchSoundH: Handle;
  64.         gShotSoundH: Handle;
  65.         gBoomSoundH: Handle;
  66.         gEndorsementSndH: Handle;
  67.  
  68.         gSoundOn, gPauseOn: Boolean;
  69.         gPlaying, gDone, gMatchIsEnding: Boolean;
  70.         myWhite, myBlack, myRed, myBlue, myYellow, myGreen, myOrange, myGray, myDkBlue: RGBColor;
  71.         gMatchTicker: Integer;
  72.  
  73.         gAppleMenu, gFileMenu, gEditMenu: MenuHandle;
  74.         gTheEvent: EventRecord;
  75.  
  76.         wneAvail, gSndIsInitted: Boolean;
  77.         gColorQDFlag, g32bQDFlag: Boolean; {not used yet}
  78.  
  79.         theSysEnv: SysEnvRec;
  80.         gOldDepth: Integer;
  81.         gMainDev: GDHandle;
  82.  
  83.         gShipRecs, gOldShipRecs: array[0..MAX_PLAYERS] of SHIPREC;
  84.         gShipSrcRects: array[0..MAX_PLAYERS, 0..8, 0..8] of Rect;
  85.  
  86.         gDebrisRecs, gOldDebrisRecs: array[0..MAX_DEBRIS] of DEBRISREC;
  87.  
  88.         gStarRecs: array[0..MAX_STARS] of STARREC;
  89.  
  90.         gShotRecs, gOldShotRecs: array[0..MAX_SHOTS] of SHOTREC;
  91.         gShotSrcRects: array[0..8] of Rect;
  92.  
  93. implementation
  94. end.